/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.foxline.clinicplus.entity;

import br.com.foxline.clinicplus.enums.TypeDebt;
import br.com.foxline.clinicplus.enums.TypeIncome;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.*;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Digits;

/**
 *
 * @author roniere
 */
@Entity
public class Cash implements Serializable {

    @Id
    @SequenceGenerator(sequenceName = "seq_cash", name = "seq_cash", allocationSize = 1)
    @GeneratedValue(generator = "seq_cash", strategy = GenerationType.SEQUENCE)
    private Long id;
    
    @Column(scale= 4, precision=10)
    @Digits( fraction = 4, integer = 10 )
    private BigDecimal value;
    
    @Enumerated(EnumType.STRING)
    private TypeIncome typeIncome;
    
    private String description;
    
    @ManyToOne
    private SystemUser systemUser;
    
    @Temporal(javax.persistence.TemporalType.TIMESTAMP)
    private Date creatAt;
    
    private boolean status;
    
    private boolean closeCash;

    @ManyToOne
    private ContaBancaria contaBancaria;
    
    public Cash() {
        this.status = true;
        this.closeCash = false;
    }

    public ContaBancaria getContaBancaria() {
        return contaBancaria;
    }

    public void setContaBancaria(ContaBancaria contaBancaria) {
        this.contaBancaria = contaBancaria;
    }

    public boolean isCloseCash() {
        return closeCash;
    }

    public void setCloseCash(boolean closeCash) {
        this.closeCash = closeCash;
    }

    
    public Date getCreatAt() {
        return creatAt;
    }

    public void setCreatAt(Date creatAt) {
        this.creatAt = creatAt;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public boolean isStatus() {
        return status;
    }

    public void setStatus(boolean status) {
        this.status = status;
    }

    public SystemUser getSystemUser() {
        return systemUser;
    }

    public void setSystemUser(SystemUser systemUser) {
        this.systemUser = systemUser;
    }

    public TypeIncome getTypeIncome() {
        return typeIncome;
    }

    public void setTypeIncome(TypeIncome typeIncome) {
        this.typeIncome = typeIncome;
    }

    public BigDecimal getValue() {
        return value;
    }

    public void setValue(BigDecimal value) {
        this.value = value;
    }
    
    
}
